<div class="form_container" style="width: 480px;">
	<table>
		<tr>
			<td colspan="2"><span class="label" style="text-transform: uppercase;">{translate}Input data into report{/translate}: </span><span class="field" style="text-transform: uppercase;">{$report->getName()}</span></td>
		</tr>		
	</table>
</div>

<div class="separator"></div>

<table>
	<tr>
		<td colspan="3"><span id="errMsgInputData" class="formAlertMsg"></span></td>
	</tr>
	<tr>	
		<td style="width: 80px;">
			<span class="label">{translate}Add row{/translate}</span>
		</td>
		<td style="width: 80px;">
			<input type="text" id="rowNumber" style="width: 60px;" maxlength="5" title="{translate}Input the number of row(s) you need add{/translate}:" value="5">
		</td>
		<td >
			<a class="button_link" href="javascript:addRow()" title="{translate}Add row{/translate}">{translate}Add{/translate}</a>
		</td>
	</tr>
</table>

<div class="separator"></div>

<form id="frmInputData">
	<input type="hidden" name="reportId" id="reportId" value="{$report->get_id()}">
	<table id="tblInputData" class="grid" style="width: 502px;" cellspacing='0' cellpadding='0'>
		<thead>
			<tr>
				<th class="first" style="width: 60px;">{translate}Order{/translate}</th>
				<th style="width: 150px;">{$report->getMetricName()}</th>
				<th style="width: 150px;">{$report->getDataName()}</th>
				<th class="last" style="width: 40px;">&nbsp;</th>
			</tr>
		</thead>
		<tbody>
			{php}
			$rowNumbers	=	$this->get_template_vars('rowNumbers');
			$data		=	$this->get_template_vars('data');
			
			$delete			=	L10nHelper::_('Delete');
			$deleteTitle	=	L10nHelper::_('Delete row');
			
			$i = 0;
			for(;$i < $rowNumbers; $i++){
				$row	=	"<tr id='row_{$i}'>							
						<td class='first'><input type='text' name='orders[]' id='order_{$i}' style='width: 50px;' maxlength='3' onfocus='generateOrder(this.id)' value='{$data[$i]['order']}'></td>
						<td><input type='text' name='metric[]' id='metric_{$i}' style='width: 120px;' maxlength='45' value='{$data[$i]['metric_value']}'></td>
						<td><input type='text' name='data[]' id='data_{$i}' style='width: 120px;' maxlength='12' value='{$data[$i]['data_value']}'></td>
						<td class='last action'><a href='javascript:deleteRow({$i})'><img src='{$base_uri}images/remove_small.png' title='{$deleteTitle}' alt='{$delete}'></a></td></tr>";
				
				echo $row;
			}
			{/php}
		</tbody>
	</table>
</form>

<div class="separator"></div>

<div>
	<div id="actionButtons" style="display: inline;">
		<input type="button" value="&lt;&lt; {translate}Edit report{/translate}" id="btnEditReport" onclick="editReport({$report->get_id()})" title="{translate}Edit report{/translate}">
		&nbsp;<input type="button" value="{translate}Save{/translate}" id="btnSaveReportData" onclick="saveReportData()" title="{translate}Save info{/translate}">
	</div>
	<div style="display: none;" id="loading">
		<img src="{$base_uri}images/ajax-loader.gif">
	</div>
	&nbsp;<span id="msgInputData" style="font-style: italic"></span>
</div>